package com.sy.controller;

import com.sy.dto.JsonResult;
import com.sy.entity.Area;
import com.sy.service.CartoonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("areas")
public class AreaController {

    @Autowired
    private CartoonService service;

    /**
     * 地区的所有分类
     */
    @RequestMapping(method = RequestMethod.GET)
    @ResponseBody
    public JsonResult getAllArea(){
        List<Area> allArea = service.getAllArea();
        JsonResult result = new JsonResult();
        result.setData(allArea);
        result.setCode(200);
        return result;

}
}
